package com.cdp.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdp.common.core.domain.AjaxResult;
import com.cdp.common.core.domain.entity.SysFlyash;
import com.cdp.common.core.domain.entity.SysFlyashType;
import com.cdp.common.core.domain.entity.SysSandFineness;
import com.cdp.system.dto.FlyashDTO;
import com.cdp.system.dto.StoneGrainDTO;
import com.cdp.system.mapper.SysFlyashMapper;
import com.cdp.system.service.ISysFlyashService;
import com.cdp.system.vo.SysFlyashVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 粉煤灰服务实现类
 */
@Service
public class SysFlyashServiceImpl extends ServiceImpl<SysFlyashMapper, SysFlyash> implements ISysFlyashService {

    @Autowired

    private  SysFlyashMapper sysFlyashMapper;

    @Override
    public List<SysFlyash> listFlyash() {
        List<SysFlyash> list = list();
        return list;
    }

    /**
     * 查询粉煤灰的最大值最小值
     * @return
     */
    @Override
    public Map<String, Object> queryFlyashMaxMin() {

        return sysFlyashMapper.queryFlyashMaxMin();
    }

    /**
     * 地区模糊查询
     * @param flyashDTO
     * @return
     */
    @Override
    public AjaxResult listMistedFlyash(FlyashDTO flyashDTO) {
       List<SysFlyashVO> sysFlyashVOS= sysFlyashMapper.listMistedFlyash(flyashDTO);
        return AjaxResult.success(sysFlyashVOS);
    }


    @Override
    public List<SysFlyash> listFlyashIds(List<Integer> flyashIds) {
        if (flyashIds == null || flyashIds.isEmpty()) {
            return Collections.emptyList();
        }

        return sysFlyashMapper.listFlyashIds(flyashIds);
    }


}
